.class public Llt/noframe/gpsfarmguide/notifications/FarmisNotificationHelper;
.super Ljava/lang/Object;
.source "FarmisNotificationHelper.java"


# direct methods
.method public static convertToString([Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 6

    .line 175
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    .line 178
    array-length v1, p0

    const/4 v2, 0x0

    const/4 v3, 0x1

    const/4 v3, 0x0

    const/4 v4, 0x1

    :goto_0
    if-ge v3, v1, :cond_1

    aget-object v5, p0, v3

    if-nez v4, :cond_0

    .line 181
    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    goto :goto_1

    :cond_0
    const/4 v4, 0x0

    .line 187
    :goto_1
    invoke-virtual {v0, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    .line 190
    :cond_1
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p0

    return-object p0
.end method

.method public static createNotificationListIntent(Landroid/content/Context;)Landroid/content/Intent;
    .locals 2

    .line 63
    new-instance v0, Landroid/content/Intent;

    const-class v1, Llt/noframe/gpsfarmguide/views/NotificationDetailsActivity;

    invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    const/high16 p0, 0x10000000

    .line 64
    invoke-virtual {v0, p0}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;

    const/high16 p0, 0x4000000

    .line 65
    invoke-virtual {v0, p0}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;

    return-object v0
.end method

.method public static getArgument([Ljava/lang/String;I)Ljava/lang/String;
    .locals 1

    .line 121
    invoke-static {p0, p1}, Llt/noframe/gpsfarmguide/notifications/FarmisNotificationHelper;->validateArgument([Ljava/lang/String;I)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 122
    aget-object p0, p0, p1

    return-object p0

    :cond_0
    const/4 p0, 0x0

    return-object p0
.end method

.method public static getArgument([Ljava/lang/String;ILjava/lang/String;)Ljava/lang/String;
    .locals 0

    .line 141
    invoke-static {p0, p1}, Llt/noframe/gpsfarmguide/notifications/FarmisNotificationHelper;->getArgument([Ljava/lang/String;I)Ljava/lang/String;

    move-result-object p0

    .line 143
    invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result p1

    if-eqz p1, :cond_0

    move-object p0, p2

    :cond_0
    return-object p0
.end method

.method public static getArgumentsFromNotificationData(Lorg/json/JSONObject;)[Ljava/lang/String;
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/json/JSONException;
        }
    .end annotation

    const-string v0, "term-args"

    .line 80
    invoke-virtual {p0, v0}, Lorg/json/JSONObject;->optJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object p0

    const/4 v0, 0x0

    if-eqz p0, :cond_0

    .line 83
    invoke-virtual {p0}, Lorg/json/JSONArray;->length()I

    move-result v1

    goto :goto_0

    :cond_0
    const/4 v1, 0x0

    .line 85
    :goto_0
    new-array v2, v1, [Ljava/lang/String;

    :goto_1
    if-ge v0, v1, :cond_1

    .line 87
    invoke-virtual {p0, v0}, Lorg/json/JSONArray;->getString(I)Ljava/lang/String;

    move-result-object v3

    aput-object v3, v2, v0

    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    :cond_1
    return-object v2
.end method

.method public static getControllerWithProjectSettings(Landroid/content/Context;)Llt/farmis/libraries/notificationcontroller/NotificationController;
    .locals 4

    .line 45
    invoke-static {p0}, Llt/farmis/libraries/notificationcontroller/NotificationController;->with(Landroid/content/Context;)Llt/farmis/libraries/notificationcontroller/NotificationController;

    move-result-object v0

    invoke-static {}, Llt/farmis/libraries/notificationcontroller/NotificationControllerSettings;->buildNewSettings()Llt/farmis/libraries/notificationcontroller/NotificationControllerSettings$Builder;

    move-result-object v1

    .line 46
    invoke-static {p0}, Llt/noframe/gpsfarmguide/notifications/FarmisNotificationHelper;->createNotificationListIntent(Landroid/content/Context;)Landroid/content/Intent;

    move-result-object p0

    invoke-virtual {v1, p0}, Llt/farmis/libraries/notificationcontroller/NotificationControllerSettings$Builder;->setFallbackNotificationOpenIntent(Landroid/content/Intent;)Llt/farmis/libraries/notificationcontroller/NotificationControllerSettings$Builder;

    const/4 p0, 0x1

    new-array p0, p0, [I

    const/4 v2, 0x0

    const/4 v3, 0x5

    aput v3, p0, v2

    .line 47
    invoke-virtual {v1, p0}, Llt/farmis/libraries/notificationcontroller/NotificationControllerSettings$Builder;->setDeliveryLimitFlags([I)Llt/farmis/libraries/notificationcontroller/NotificationControllerSettings$Builder;

    .line 48
    invoke-virtual {v1}, Llt/farmis/libraries/notificationcontroller/NotificationControllerSettings$Builder;->build()Llt/farmis/libraries/notificationcontroller/NotificationControllerSettings;

    move-result-object p0

    .line 45
    invoke-virtual {v0, p0}, Llt/farmis/libraries/notificationcontroller/NotificationController;->useSettings(Llt/farmis/libraries/notificationcontroller/NotificationControllerSettings;)Llt/farmis/libraries/notificationcontroller/NotificationController;

    return-object v0
.end method

.method public static validateArgument([Ljava/lang/String;I)Z
    .locals 3

    const/4 v0, 0x0

    if-eqz p0, :cond_2

    .line 102
    array-length v1, p0

    if-gtz v1, :cond_0

    goto :goto_0

    .line 104
    :cond_0
    array-length v1, p0

    add-int/lit8 v2, p1, 0x1

    if-ge v1, v2, :cond_1

    return v0

    .line 107
    :cond_1
    aget-object p0, p0, p1

    invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result p0

    xor-int/lit8 p0, p0, 0x1

    return p0

    :cond_2
    :goto_0
    return v0
.end method
